<?php 
	session_start();
	require 'db.php';

	if(empty($_SESSION['username'])||empty($_SESSION['userUid'])||empty($_SESSION['userAvatar'])){
		echo 2;  //参数错误
		die;
	}

	if(empty($_POST['comment'])){
		echo 3; //未填写内容  
		die;
	}

	$userUid=$_SESSION['userUid'];
	$username=$_SESSION['username'];
	$userAvatar=$_SESSION['userAvatar'];
	$comment=$_POST['comment'];
	$time=time();
	$sql_m ="INSERT INTO oc_sport_message (uid,yb_nickname,yb_face,comment,is_real,create_time,status) VALUES ('$userUid','$username','$userAvatar','$comment','1','$time','1')";
	$query=mysql_query($sql_m);
	mysql_close($link);
	if($query){
		echo 1;
	}else{
		echo 0;
	}
	

?>